package com.cn.integration.business.paycenter.service.impl;

import com.cn.integration.business.paycenter.bo.OpenAccountBo;
import com.cn.integration.business.paycenter.bo.PayFeeBo;
import com.cn.integration.business.paycenter.service.AccountService;
import com.cn.integration.business.paycenter.strategy.StrategyContext;
import com.cn.integration.business.paycenter.vo.OpenAccountVo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

@Service
public class AccountServiceImpl implements AccountService {

    @Resource
    private StrategyContext strategyContext;

    @Override
    public OpenAccountVo openAccount(OpenAccountBo bo) {
        OpenAccountVo openAccountVo = strategyContext.getPayMethod(bo.getPayChannelCode()).openAccount(bo);
        return openAccountVo;
    }

    @Override
    public String payFee(PayFeeBo bo) {
        return strategyContext.getPayMethod(bo.getPayChannelCode()).payFee(bo);
    }
}
